package org.example;

class Book extends BaseEntity {
    private String book_id;
    private String title;
    private String author;
    private int publish_year;

    public Book() {
    }

    public Book(String book_id, String title, String author, int publish_year) {
        this.book_id = book_id;
        this.title = title;
        this.author = author;
        this.publish_year = publish_year;
    }

    @Override
    public String getPrimaryKey() {
        return "book_id";
    }

    public String getBook_id() {
        return book_id;
    }

    public void setBook_id(String book_id) {
        this.book_id = book_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPublish_year() {
        return publish_year;
    }

    public void setPublish_year(int publish_year) {
        this.publish_year = publish_year;
    }

    @Override
    public String toString() {
        return String.format("书本编号：%s, 书名：%s, 作者：%s, 出版年份：%d",
                book_id, title, author, publish_year);
    }
}
